import * as index from '@/api/index.js'
export default {
	data() {
		return {
			form: {
				page: 1,
				row: 10
			},
			forms:{
				wechat_account:'',
				money:''
			},
			userInfo:{},
			list:[]
		}
	},
	
	onShow() {
	
	},
	onLoad(option) {
		this.getUserInfo()
		this.getWithdrawLog()
	},
	onReachBottom(){
		this.form.page=1
		this.list = []
		this.getRecharge_info()
	},
	methods: {
		getUserInfo(){
			index.getUserInfo().then(res=>{
				this.userInfo = res.data
			})
		},
		getWithdrawLog(){
			index.getWithdrawLog(this.form).then(res => {
				this.list = res.data.data
			})
		},
		jump(){
			this.$refs.money.open('center')
		},
		close(){
			this.$refs.money.close()
			this.forms.wechat_account =  ''
			this.forms.money = ''
		},
		submit(){
			let that = this
			uni.showModal({
				content: '是否发起提现申请',
				success: function (res) {
					if (res.confirm) {
						index.goWithdraw(that.forms).then(res=>{
							that.close()
							that.$tools.toast(res.msg)
							that.getWithdrawLog()
							that.getUserInfo()
						})
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				}
			});

		}
	}
}